package com.example.demo.common;

import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.concurrent.ThreadLocalRandom;

@Service
public class TimestampBaseIdIdGenerator implements IdGenerator {

    private ThreadLocalRandom random = ThreadLocalRandom.current();

    @Override
    public Long genId() {
        return new Date().getTime() * 100 + random.nextInt(100);
    }
}
